package com.link.base.task;

import com.link.base.base.serviceprojectnew.service.ServiceProjectService;
import com.link.base.core.basic.config.xxljob.BaseLinkJobHandler;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 任务汇总报告工作流
 * 定时对任务进行一个简单的汇总，然后给相关的提出人和负责人发送企业微信消息提醒
 *
 * @author xieyuqiang
 * @date 2019/3/27 17:33
 */
@JobHandler(value = "TaskSendTaskReportForWorkWx")
@Component
public class TaskSendTaskReportForWorkWx extends BaseLinkJobHandler {

    @Resource
    private ServiceProjectService serviceProjectService;

    @Override
    public ReturnT<String> execute(String params) throws Exception {
        try {
            XxlJobLogger.log("TaskSendTaskReportForWorkWx");
            super.setLogin(params);
            serviceProjectService.sendTaskReportForWorkWx();
            return ReturnT.SUCCESS;
        } catch (Exception e) {
            XxlJobLogger.log(e.getMessage());
            return ReturnT.FAIL;
        }
    }
}
